/** 
 * ---------------------------------------------------------------------------------------------------------------
 * @Copyright	Quadrangle Systems Inc.
 * @Title		ResponseStatus.java   
 * @author 		Peak Zhang
 * @date 		2014-07-11
 * @Description: 
 *				Defined response status
 * ---------------------------------------------------------------------------------------------------------------
 */ 
package com.qs.education.bean.enums;

public enum ResponseStatus {
	SUCCESS("SUCCESS"), FAILED("FAILED");
	
	private String name;
	
	private ResponseStatus(String name){
		this.name = name;
	}

	@Override
	public String toString() {
		return name;
	}
	
	public static ResponseStatus getStatus(String name){
		if(name == null || !"SUCCESS".equalsIgnoreCase(name)){
			return FAILED;
		}else{
			return SUCCESS;
		}
	}
}
